// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import MuseUI from 'muse-ui'
import store from './store'
import 'muse-ui/dist/muse-ui.css'
import theme from 'muse-ui/lib/theme'
import {messageOptions, PROTOCOL_CONTENT, themeOptions, toastOptions} from './common/config'
import 'muse-ui-message/dist/muse-ui-message.css';
import 'muse-ui-loading/dist/muse-ui-loading.css'; // load css
import Loading from 'muse-ui-loading';
import Message from 'muse-ui-message';
import Toast from 'muse-ui-toast';
import md5 from 'js-md5';
import {getStore, removeStore, setStore} from './common/storage'
import {base, getDefinedRequest, getRequest, postRequest, uploadFileRequest} from './common/api';
import util from '@/common/util.js';

theme.add('teal', themeOptions, 'light');
theme.use('teal');
Vue.use(MuseUI);
Message.config(messageOptions);
Vue.use(Message);
Toast.config(toastOptions);
Vue.use(Toast);
Vue.use(Loading);
Vue.config.productionTip = false;
Vue.prototype.getDefinedRequest = getDefinedRequest;
Vue.prototype.getRequest = getRequest;
Vue.prototype.postRequest = postRequest;
Vue.prototype.uploadFileRequest = uploadFileRequest;
Vue.prototype.baseUrl = base;
Vue.prototype.PROTOCOL_CONTENT = PROTOCOL_CONTENT;
Vue.prototype.setStore = setStore;
Vue.prototype.getStore = getStore;
Vue.prototype.md5 = md5;
Vue.prototype.removeStore = removeStore;
Vue.prototype.util = util;
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: {App},
  template: '<App/>'
})
